/*
 * Copyright (c) 2006, 2021, webrx.cn All rights reserved.
 *
 */
package cn.webrx.mapper;

import cn.webrx.model.Book;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * <p>Project: mybatis2021 - BookMapper
 * <p>Powered by webrx On 2021-10-22 20:35:01
 * <p>Created by IntelliJ IDEA
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public interface BookMapper {
    @Select("select * from book order by id desc")
    public List<Map<String, Object>> queryAll();

    @Delete("delete from book where id = #{id}")
    public int deleteById(int id);

    public int edit(Book book);

    public String ver();

    @Select("select * from book where id = #{id}")
    public Book queryById(int id);

    @Insert("insert into book(author,name,price) value(#{author},#{name},#{price})")
    public int save(Map<String, Object> map);

    @Insert("insert into book(author,name,price) value(#{aa},#{name},#{price})")
    public int add(@Param("name") String name, @Param("price") double price, @Param("aa") String author);


    @Select("select * from ${t}")
    public List<Map<String, Object>> shows(String t);

    public List<String> tbs();

    public List<String> tbs(String dbname);

}
